package trees;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class AttributeLeaf implements AttributeNode{

	private Integer attribute;
	private AttributeNode parent;
	private int positionWithinSiblings;
	
	@Override
	public int getPositionWithinSiblings() {
		return positionWithinSiblings;
	}

	@Override
	public void setPositionWithinSiblings(int positionWithinSiblings) {
		this.positionWithinSiblings = positionWithinSiblings;
	}

	public AttributeLeaf(Integer attribute){
		this.attribute = attribute;
	}
	
	public void setParent(AttributeNode parent) {
		this.parent = parent;
	}

	@Override
	public List<AttributeNode> getChildren() {
		List<AttributeNode> emptyList = new ArrayList<AttributeNode>();
		//this decorates the collection with a wrapper that throws an
		//exception if any attempt is made to add or delete elements
		return Collections.unmodifiableList(emptyList);
	}

	@Override
	public int getAttribute() {
		return attribute;
	}

	@Override
	public AttributeNode getParent() {
		return parent;
	}


	
	
}